package com.myjob.utils;

import com.alibaba.fastjson.JSONObject;
import com.myjob.entity.User;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

/**
 * @author Chen Yuan
 * @create 2021-03-26  15:06
 */
public class AnalysisAuthToken {
	public static User getUserFromToken(String token){
		User user = null;
		try {
			token = URLDecoder.decode(token, "UTF-8");
			user = JSONObject.parseObject(token, User.class);
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return user;
	}
}
